package com.ssy.lingxi.pay.serviceimpl;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.pay.service.IProcessFeignService;
import com.ssy.lingxi.pay.utils.FeignLogUtils;
import com.ssy.lingxi.workflow.api.feign.ProcessFeign;
import com.ssy.lingxi.workflow.api.model.vo.request.*;
import com.ssy.lingxi.workflow.api.model.vo.response.ComplexTaskCompleteVO;
import com.ssy.lingxi.workflow.api.model.vo.response.ComplexTaskDefVO;
import com.ssy.lingxi.workflow.api.model.vo.response.SimpleProcessDefVO;
import com.ssy.lingxi.workflow.api.model.vo.response.SimpleTaskCompleteVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 *  新工作流feign
 * @author ds
 * @date 2021/5/20
 * @version 2.0.0
 */
@Service
public class ProcessFeignServiceImpl implements IProcessFeignService {


    private static final Logger logger = LoggerFactory.getLogger(ProcessFeignServiceImpl.class);

    /**
     * 工作流接口
     */
    @Resource
    private ProcessFeign processFeign;

    @Override
    public Wrapper<ComplexTaskCompleteVO> startProcess(TaskStartVO startVO) {
        Wrapper<ComplexTaskCompleteVO> complexTaskCompleteVOWrapper = processFeign.startProcess(startVO);
        FeignLogUtils.printLog("startProcess",complexTaskCompleteVOWrapper);
        return complexTaskCompleteVOWrapper;
    }

    @Override
    public Wrapper<ComplexTaskCompleteVO> startProcessThenCompleteFirstTask(TaskStartVO startVO) {
        Wrapper<ComplexTaskCompleteVO> complexTaskCompleteVOWrapper = processFeign.startProcessThenCompleteFirstTask(startVO);
        FeignLogUtils.printLog("startProcessThenCompleteFirstTask",complexTaskCompleteVOWrapper);
        return complexTaskCompleteVOWrapper;
    }

    @Override
    public Wrapper<ComplexTaskCompleteVO> completeTask(TaskExecuteVO executeVO) {
        Wrapper<ComplexTaskCompleteVO> complexTaskCompleteVOWrapper = processFeign.completeTask(executeVO);
        FeignLogUtils.printLog("completeTask",complexTaskCompleteVOWrapper);
        return complexTaskCompleteVOWrapper;
    }

    @Override
    public Wrapper<SimpleTaskCompleteVO> startSimpleProcess(TaskStartVO startVO) {
        Wrapper<SimpleTaskCompleteVO> complexTaskCompleteVOWrapper = processFeign.startSimpleProcess(startVO);
        FeignLogUtils.printLog("startSimpleProcess",complexTaskCompleteVOWrapper);
        return complexTaskCompleteVOWrapper;
    }

    @Override
    public Wrapper<SimpleTaskCompleteVO> startSimpleProcessThenCompleteFirstTask(TaskStartVO startVO) {
        Wrapper<SimpleTaskCompleteVO> complexTaskCompleteVOWrapper = processFeign.startSimpleProcessThenCompleteFirstTask(startVO);
        FeignLogUtils.printLog("startSimpleProcessThenCompleteFirstTask",complexTaskCompleteVOWrapper);
        return complexTaskCompleteVOWrapper;
    }

    @Override
    public Wrapper<SimpleTaskCompleteVO> completeSimpleTask(TaskExecuteVO executeVO) {
        Wrapper<SimpleTaskCompleteVO> complexTaskCompleteVOWrapper = processFeign.completeSimpleTask(executeVO);
        FeignLogUtils.printLog("completeSimpleTask",complexTaskCompleteVOWrapper);
        return complexTaskCompleteVOWrapper;
    }

    @Override
    public Wrapper<List<Long>> findProcessDataIds(ProcessDataQueryVO queryVO) {
        Wrapper<List<Long>> complexTaskCompleteVOWrapper = processFeign.findProcessDataIds(queryVO);
        FeignLogUtils.printLog("findProcessDataIds",complexTaskCompleteVOWrapper);
        return complexTaskCompleteVOWrapper;
    }

    @Override
    public Wrapper<ComplexTaskDefVO> findComplexTaskDefinitions(ComplexProcessQueryVO queryVO) {
        Wrapper<ComplexTaskDefVO> complexTaskCompleteVOWrapper = processFeign.findComplexTaskDefinitions(queryVO);
        FeignLogUtils.printLog("findComplexTaskDefinitions",complexTaskCompleteVOWrapper);
        return complexTaskCompleteVOWrapper;
    }

    @Override
    public Wrapper<SimpleProcessDefVO> findSimpleExternalTaskDefinitions(ExternalProcessQueryVO queryVO) {
        Wrapper<SimpleProcessDefVO> complexTaskCompleteVOWrapper = processFeign.findSimpleExternalTaskDefinitions(queryVO);
        FeignLogUtils.printLog("findSimpleExternalTaskDefinitions",complexTaskCompleteVOWrapper);
        return complexTaskCompleteVOWrapper;
    }

    @Override
    public Wrapper<SimpleProcessDefVO> findSimpleInternalTaskDefinitions(InternalProcessQueryVO queryVO) {
        Wrapper<SimpleProcessDefVO> complexTaskCompleteVOWrapper = processFeign.findSimpleInternalTaskDefinitions(queryVO);
        FeignLogUtils.printLog("findSimpleInternalTaskDefinitions",complexTaskCompleteVOWrapper);
        return complexTaskCompleteVOWrapper;
    }
}
